package com.example.demozmq.thread;

import java.io.UnsupportedEncodingException;
import lombok.SneakyThrows;

public class SneakyThrowsTest implements Runnable{

    @SneakyThrows(UnsupportedEncodingException.class)
    public String utf8ToString(byte[] bytes) throws UnsupportedEncodingException {
        return new String(bytes, "UTF-8");
    }

    @Override
    @SneakyThrows
    public void run() {
        try {
            throw new Throwable();
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }
}
